// api/finance.js
import http from '@/utils/http.js'  // 导入你封装好的 http

// 获取支付账户
export function getPayAccount() {
    return http.post('/sysCommon/getPayAccount')
}

// 添加记录
export function addRecordReq(data) {
    return http.post('/finance/addRecord', data)
}

// 删除记录
export function delRecordReq(data) {
    return http.post('/finance/delRecord', data)
}

// 删除财务账户
export function deleteFinanceAccountById(data) {
    return http.post('/finance/deleteFinanceAccountById', data)
}

// 根据ID获取记录
export function getRecordById(params) {
    return http.post('/finance/getRecordById', {}, {params})
}

// 获取记录类型字典
export function getRecordTypes() {
    return http.post('/finance/getRecordTypesDictionary')
}

// 查询某月的消费记录
export function getFinanceRecordsByMonth(data) {
    return http.post('/finance/getFinanceRecordsByMonth', data)
}

/**
 * 获取某天的消费记录
 * @param params
 * @returns {*}
 */
export function getFinanceRecordsByDay(params) {
    return http.post('/finance/getFinanceRecordsByDay', {}, {params})
}

/**
 * 财富重算
 * @param {*} params
 * @returns
 */
export function handleDailyHistory(params) {
    return http.post('/financeDailyStatistics/handleDailyHistory', {}, {params})
}

/**
 * 财富页面数据一览
 * @param {*} params
 * @returns
 */
export function getGlance(params) {
    return http.post('/financeDailyStatistics/getGlance', {}, {params})
}
